import request from '@/utils/request'
import { renderUrl } from '../utils'

const headers = {
  'Content-Type': 'application/json'
}

export function add(data) {
  return request({
    url: '/returnReason/create',
    method: 'POST',
    data: JSON.stringify(data),
    headers
  })
}

export function edit(data) {
  return request({
    url: renderUrl('/returnReason/update/{id}', data),
    method: 'POST',
    data: JSON.stringify(data),
    headers
  })
}

export function del(data) {
  return request({
    url: '/returnReason/delete',
    method: 'POST',
    data: JSON.stringify(data),
    headers
  })
}

export function toDisableAndOpen(params) {
  return request({
    url: '/returnReason/update/status',
    method: 'POST',
    params
  })
}

export default { add, edit, del }
